home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / dhtmlunl / dhtml.exe / CD Content / Chap08 / dun8_5.txt < prev    next >
Encoding:
Text File  |  1997-12-18  |  1.1 KB  |  41 lines

  1. <html>
  2.  
  3. <head>
  4.  
  5. <title>Doorway</title>
  6.  
  7. </head>
  8.  
  9. <script language="JavaScript1.2">
  10.  
  11. <!---//
  12.  
  13. //by specifying 'JavaScript1.2' as the scripting
  14.  
  15. //language, only NS 4.0 and higher "sees" this script.
  16.  
  17. //the routeMe() function simply changes the current
  18.  
  19. //window's location to Netscape's page.
  20.  
  21. function routeMe() {
  22.  
  23.     self.location="http://www.netscape.com/";
  24.  
  25.     return false;
  26.  
  27.     //some people have asked why I use "return false"
  28.  
  29.     //on this script.  Simple... the onClick event is
  30.  
  31.     //setting netscape up to link to another page. By
  32.  
  33.     //returning "false", you're telling the browser not
  34.  
  35.     //to follow that link.
  36.  
  37. }
  38.  
  39. //--->
  40.  
  41. </script>
  42.  
  43. <script language="VBScript">
  44.  
  45. <!---//
  46.  
  47. //by specifying 'VBScript' as the scripting language for
  48.  
  49. //this block, only MSIE 3.0 and higher "sees" this script.
  50.  
  51. //again, the routeMe() sub changes the current
  52.  
  53. //window's location to Microsoft's page.
  54.  
  55. Sub routeMe()
  56.  
  57.     self.location="http://www.microsoft.com/"
  58.  
  59. End Sub
  60.  
  61. //--->
  62.  
  63. </script>
  64.  
  65. <body bgcolor="#ffffff">
  66.  
  67. <center>
  68.  
  69. <form>
  70.  
  71. <input type="button" onClick="routeMe()" value="Go Home!">
  72.  
  73. </form>
  74.  
  75. </center>
  76.  
  77. </body>
  78.  
  79. </html>
  80.  
  81.